// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsINetworkInterface.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    ///This Source Code Form is subject to the terms of the Mozilla Public
    /// License, v. 2.0. If a copy of the MPL was not distributed with this file,
    /// You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("f439ab5d-64bd-4a6c-8863-30235fa784d2")]
	public interface nsINetworkInfo
	{
		
		/// <summary>
        /// Current network state, one of the NETWORK_STATE_* constants.
        ///
        /// When this changes, network interface implementations notify with
        /// updateNetworkInterface() API.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetStateAttribute();
		
		/// <summary>
        /// Network type. One of the NETWORK_TYPE_* constants.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetTypeAttribute();
		
		/// <summary>
        /// Interface name of the network interface this network info belongs to.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetNameAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aName);
		
		/// <summary>
        /// Get the list of ip addresses and prefix lengths, ip address could be IPv4
        /// or IPv6, typically 1 IPv4 or 1 IPv6 or one of each.
        ///
        /// @param ips
        /// The list of ip addresses retrieved.
        /// @param prefixLengths
        /// The list of prefix lengths retrieved.
        ///
        /// @returns the length of the lists.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetAddresses([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)] ref System.IntPtr[] ips, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)] ref uint[] prefixLengths);
		
		/// <summary>
        /// Get the list of gateways, could be IPv4 or IPv6, typically 1 IPv4 or 1
        /// IPv6 or one of each.
        ///
        /// @param count
        /// The length of the list of gateways
        ///
        /// @returns the list of gateways.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetGateways(ref uint count, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref System.IntPtr[] gateways);
		
		/// <summary>
        /// Get the list of dnses, could be IPv4 or IPv6.
        ///
        /// @param count
        /// The length of the list of dnses.
        ///
        /// @returns the list of dnses.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetDnses(ref uint count, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref System.IntPtr[] dnses);
	}
	
	/// <summary>nsINetworkInfoConsts </summary>
	public class nsINetworkInfoConsts
	{
		
		// <summary>
        //This Source Code Form is subject to the terms of the Mozilla Public
        // License, v. 2.0. If a copy of the MPL was not distributed with this file,
        // You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
		public const long NETWORK_STATE_UNKNOWN = -1;
		
		// 
		public const long NETWORK_STATE_CONNECTING = 0;
		
		// 
		public const long NETWORK_STATE_CONNECTED = 1;
		
		// 
		public const long NETWORK_STATE_DISCONNECTING = 2;
		
		// 
		public const long NETWORK_STATE_DISCONNECTED = 3;
		
		// 
		public const long NETWORK_TYPE_UNKNOWN = -1;
		
		// 
		public const long NETWORK_TYPE_WIFI = 0;
		
		// 
		public const long NETWORK_TYPE_MOBILE = 1;
		
		// 
		public const long NETWORK_TYPE_MOBILE_MMS = 2;
		
		// 
		public const long NETWORK_TYPE_MOBILE_SUPL = 3;
		
		// 
		public const long NETWORK_TYPE_WIFI_P2P = 4;
		
		// 
		public const long NETWORK_TYPE_MOBILE_IMS = 5;
		
		// 
		public const long NETWORK_TYPE_MOBILE_DUN = 6;
		
		// 
		public const long NETWORK_TYPE_MOBILE_FOTA = 7;
	}
	
	/// <summary>nsINetworkInterface </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("8b1345fa-b34c-41b3-8d21-09f961bf8887")]
	public interface nsINetworkInterface
	{
		
		/// <summary>
        /// The network information about this network interface.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsINetworkInfo GetInfoAttribute();
		
		/// <summary>
        /// The host name of the http proxy server.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetHttpProxyHostAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aHttpProxyHost);
		
		/// <summary>
        /// The port number of the http proxy server.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetHttpProxyPortAttribute();
		
		/// <summary>
        /// The Maximun Transmit Unit for this network interface, -1 if not set.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetMtuAttribute();
	}
}
